<template>
  <div class="bdclass" :style="bdclass" >
  		<div style="height:100px"></div>
  		<img :src="logoUrl" class="logoclass">
  		<!-- <div style="height:50px"></div> -->
  		<div class="MainBox">
	  		<Form :model="checkForm" :label-width="0" >
	  			<Form-item >
	            	<Input  v-model="checkForm.number" placeholder="请输入客户微信号/手机号查询" style="width: 70%"></Input>
	      		  </Form-item>
		  		<Form-item>
		  				<Button  class="buttonStyle pinkButton" @click="checkFormSubmit">提交</Button>

		  		</Form-item>
	  		</Form>

		</div>
  		<div style="height:200px"></div>
  </div>
</template>
<script>
import Store from '../store'
import vuex_store from '../js/vuex-store'
import api from '../js/axios-module'
export default {

  data () {
    return {
    	isLogin:false,
    	checkForm:{
    		number:""
    	},
    	loginForm:{
			accout:'',
			password:''
    	},
        bgUrl:require('../assets/bg.png'),
        logoUrl:require('../assets/logo.png'),
        bdclass:{
        	'width': '100%',
        	'height': '100%',
			"background-repeat": "no-repeat",
			'background-size': '100%',
			"background-image": 'url('+require('../assets/bg.png')+')'
        }
    }
  },
  store:vuex_store,
  components:{
  	//
  },methods:{

	checkFormSubmit:function(){


		if (this.checkForm.number=="") {

			this.$Message.error("请填写手机号码/或者微信");
			return;
		}

		api.getToken({'mobile': this.checkForm.number}).then(response => {
			//设置token
			this.$store.commit("setUserToken",response.data.data)
			//路由跳转
			this.$router.push({path:'/BaseMessage'})
		    Store.save("/BaseMessage",Store.CURRENTROUTE_KEY);
        },err=>{

			    this.$Message.error("无法查询该用户,请刷新页面");

        })




	}



  }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>   /*  scoped的意思是这里的样式只对当前页面有效不会影响其他页面，还有可以设置lang="scss"就是支持css预编译，也就是支持sass或者less  */

.logoclass{
	width: 30%;
	height: 30%;
}
</style>
